.class public Lcom/example/m6wmr/YucartActivity$delgdClickListener;
.super Ljava/lang/Object;
.source "YucartActivity.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/example/m6wmr/YucartActivity;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "delgdClickListener"
.end annotation


# instance fields
.field private goodsid:Ljava/lang/String;

.field final synthetic this$0:Lcom/example/m6wmr/YucartActivity;


# direct methods
.method public constructor <init>(Lcom/example/m6wmr/YucartActivity;Ljava/lang/String;)V
    .locals 0
    .param p2, "gid"    # Ljava/lang/String;

    .prologue
    .line 674
    iput-object p1, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 675
    iput-object p2, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->goodsid:Ljava/lang/String;

    .line 677
    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 10
    .param p1, "v"    # Landroid/view/View;

    .prologue
    const/4 v9, 0x0

    .line 681
    new-instance v2, Lbean/GoodsBean;

    invoke-direct {v2}, Lbean/GoodsBean;-><init>()V

    .line 682
    .local v2, "mygoods":Lbean/GoodsBean;
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->goodsls:Ljava/util/List;
    invoke-static {v4}, Lcom/example/m6wmr/YucartActivity;->access$0(Lcom/example/m6wmr/YucartActivity;)Ljava/util/List;

    move-result-object v4

    invoke-interface {v4}, Ljava/util/List;->size()I

    move-result v4

    const/4 v5, 0x1

    if-ge v4, v5, :cond_0

    .line 683
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->mcontext:Landroid/content/Context;
    invoke-static {v4}, Lcom/example/m6wmr/YucartActivity;->access$1(Lcom/example/m6wmr/YucartActivity;)Landroid/content/Context;

    move-result-object v4

    const-string v5, "\u66f4\u65b0\u8d2d\u7269\u8f66"

    const-string v6, "\u5546\u54c1\u4e0d\u5b58\u5728"

    invoke-static {v4, v5, v6}, Lmyapp/Util;->alertdialog(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    .line 715
    :goto_0
    return-void

    .line 687
    :cond_0
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    iget-object v5, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->helper:Ldbclass/DBOpenHelper;
    invoke-static {v5}, Lcom/example/m6wmr/YucartActivity;->access$2(Lcom/example/m6wmr/YucartActivity;)Ldbclass/DBOpenHelper;

    move-result-object v5

    invoke-virtual {v5}, Ldbclass/DBOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v5

    .line 688
    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "select * from cart where goodsid="

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v7, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->goodsid:Ljava/lang/String;

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    .line 687
    invoke-virtual {v5, v6, v9}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/example/m6wmr/YucartActivity;->access$3(Lcom/example/m6wmr/YucartActivity;Landroid/database/Cursor;)V

    .line 689
    const/4 v1, 0x0

    .line 690
    .local v1, "goodscount":I
    const/4 v0, 0x1

    .line 691
    .local v0, "checkgd":Z
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->cursor:Landroid/database/Cursor;
    invoke-static {v4}, Lcom/example/m6wmr/YucartActivity;->access$4(Lcom/example/m6wmr/YucartActivity;)Landroid/database/Cursor;

    move-result-object v4

    if-eqz v4, :cond_3

    .line 692
    :goto_1
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->cursor:Landroid/database/Cursor;
    invoke-static {v4}, Lcom/example/m6wmr/YucartActivity;->access$4(Lcom/example/m6wmr/YucartActivity;)Landroid/database/Cursor;

    move-result-object v4

    invoke-interface {v4}, Landroid/database/Cursor;->moveToNext()Z

    move-result v4

    if-nez v4, :cond_2

    .line 700
    :goto_2
    if-eqz v0, :cond_1

    .line 701
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->mcontext:Landroid/content/Context;
    invoke-static {v4}, Lcom/example/m6wmr/YucartActivity;->access$1(Lcom/example/m6wmr/YucartActivity;)Landroid/content/Context;

    move-result-object v4

    const-string v5, "\u66f4\u65b0\u8d2d\u7269\u8f66"

    const-string v6, "\u8d2d\u7269\u8f66\u5546\u54c1\u4e0d\u5b58\u5728"

    invoke-static {v4, v5, v6}, Lmyapp/Util;->alertdialog(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    .line 703
    :cond_1
    add-int/lit8 v3, v1, -0x1

    .line 704
    .local v3, "newgoodcount":I
    if-nez v3, :cond_4

    .line 706
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->db:Landroid/database/sqlite/SQLiteDatabase;
    invoke-static {v4}, Lcom/example/m6wmr/YucartActivity;->access$5(Lcom/example/m6wmr/YucartActivity;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v4

    const-string v5, "cart"

    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "goodsid = \'"

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v7, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->goodsid:Ljava/lang/String;

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "\'"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v5, v6, v9}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I

    .line 714
    :goto_3
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    invoke-virtual {v4}, Lcom/example/m6wmr/YucartActivity;->freshcart()V

    goto :goto_0

    .line 693
    .end local v3    # "newgoodcount":I
    :cond_2
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->cursor:Landroid/database/Cursor;
    invoke-static {v4}, Lcom/example/m6wmr/YucartActivity;->access$4(Lcom/example/m6wmr/YucartActivity;)Landroid/database/Cursor;

    move-result-object v4

    iget-object v5, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->cursor:Landroid/database/Cursor;
    invoke-static {v5}, Lcom/example/m6wmr/YucartActivity;->access$4(Lcom/example/m6wmr/YucartActivity;)Landroid/database/Cursor;

    move-result-object v5

    const-string v6, "goodscount"

    invoke-interface {v5, v6}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v5

    invoke-interface {v4, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v1

    .line 694
    const/4 v0, 0x0

    goto :goto_1

    .line 698
    :cond_3
    const/4 v0, 0x1

    goto :goto_2

    .line 710
    .restart local v3    # "newgoodcount":I
    :cond_4
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->cv:Landroid/content/ContentValues;
    invoke-static {v4}, Lcom/example/m6wmr/YucartActivity;->access$6(Lcom/example/m6wmr/YucartActivity;)Landroid/content/ContentValues;

    move-result-object v4

    const-string v5, "goodscount"

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v6

    invoke-virtual {v4, v5, v6}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 711
    iget-object v4, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->db:Landroid/database/sqlite/SQLiteDatabase;
    invoke-static {v4}, Lcom/example/m6wmr/YucartActivity;->access$5(Lcom/example/m6wmr/YucartActivity;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v4

    const-string v5, "cart"

    iget-object v6, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->this$0:Lcom/example/m6wmr/YucartActivity;

    # getter for: Lcom/example/m6wmr/YucartActivity;->cv:Landroid/content/ContentValues;
    invoke-static {v6}, Lcom/example/m6wmr/YucartActivity;->access$6(Lcom/example/m6wmr/YucartActivity;)Landroid/content/ContentValues;

    move-result-object v6

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "goodsid = \'"

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v8, p0, Lcom/example/m6wmr/YucartActivity$delgdClickListener;->goodsid:Ljava/lang/String;

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, "\'"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v5, v6, v7, v9}, Landroid/database/sqlite/SQLiteDatabase;->update(Ljava/lang/String;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    goto :goto_3
.end method
